EAPI=7

EGIT_REPO_URI="https://github.com/mosra/magnum-plugins.git"

inherit cmake git-r3

DESCRIPTION="Plugins for the Magnum C++11/C++14 graphics engine"
HOMEPAGE="https://magnum.graphics"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

RDEPEND="
	dev-libs/magnum
	media-libs/devil
	media-libs/faad2
	media-libs/freetype
	media-libs/harfbuzz
	media-libs/openexr
	virtual/jpeg
	media-libs/libpng
	media-libs/libwebp
	media-libs/assimp
	dev-util/glslang
	dev-util/spirv-tools
"
DEPEND="${RDEPEND}"

src_configure() {
	# general configuration
	local mycmakeargs=(
		-DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
		-DCMAKE_BUILD_TYPE=Release
		-DMAGNUM_WITH_ASSIMPIMPORTER=ON
		-DMAGNUM_WITH_ASTCIMPORTER=ON
		-DMAGNUM_WITH_BASISIMAGECONVERTER=OFF
		-DMAGNUM_WITH_BASISIMPORTER=OFF
		-DMAGNUM_WITH_BCDECIMAGECONVERTER=ON
		-DMAGNUM_WITH_CGLTFIMPORTER=ON
		-DMAGNUM_WITH_DDSIMPORTER=ON
		-DMAGNUM_WITH_DEVILIMAGEIMPORTER=ON
		-DMAGNUM_WITH_DRFLACAUDIOIMPORTER=ON
		-DMAGNUM_WITH_DRMP3AUDIOIMPORTER=ON
		-DMAGNUM_WITH_DRWAVAUDIOIMPORTER=ON
		-DMAGNUM_WITH_ETCDECIMAGECONVERTER=ON
		-DMAGNUM_WITH_FAAD2AUDIOIMPORTER=ON
		-DMAGNUM_WITH_FREETYPEFONT=ON
		-DMAGNUM_WITH_GLSLANGSHADERCONVERTER=ON
		-DMAGNUM_WITH_GLTFIMPORTER=ON
		-DMAGNUM_WITH_GLTFSCENECONVERTER=ON
		-DMAGNUM_WITH_HARFBUZZFONT=ON
		-DMAGNUM_WITH_ICOIMPORTER=ON
		-DMAGNUM_WITH_JPEGIMAGECONVERTER=ON
		-DMAGNUM_WITH_JPEGIMPORTER=ON
		-DMAGNUM_WITH_KTXIMAGECONVERTER=ON
		-DMAGNUM_WITH_KTXIMPORTER=ON
		-DMAGNUM_WITH_MESHOPTIMIZERSCENECONVERTER=OFF
		-DMAGNUM_WITH_MINIEXRIMAGECONVERTER=ON
		-DMAGNUM_WITH_OPENEXRIMAGECONVERTER=ON
		-DMAGNUM_WITH_OPENEXRIMPORTER=ON
		-DMAGNUM_WITH_OPENGEXIMPORTER=ON
		-DMAGNUM_WITH_PNGIMAGECONVERTER=ON
		-DMAGNUM_WITH_PNGIMPORTER=ON
		-DMAGNUM_WITH_PRIMITIVEIMPORTER=ON
		-DMAGNUM_WITH_SPIRVTOOLSSHADERCONVERTER=ON
		-DMAGNUM_WITH_SPNGIMPORTER=OFF
		-DMAGNUM_WITH_STANFORDIMPORTER=ON
		-DMAGNUM_WITH_STANFORDSCENECONVERTER=ON
		-DMAGNUM_WITH_STBDXTIMAGECONVERTER=ON
		-DMAGNUM_WITH_STBIMAGECONVERTER=ON
		-DMAGNUM_WITH_STBIMAGEIMPORTER=ON
		-DMAGNUM_WITH_STBRESIZEIMAGECONVERTER=ON
		-DMAGNUM_WITH_STBTRUETYPEFONT=ON
		-DMAGNUM_WITH_STBVORBISAUDIOIMPORTER=ON
		-DMAGNUM_WITH_STLIMPORTER=ON
		-DMAGNUM_WITH_TINYGLTFIMPORTER=ON
		-DMAGNUM_WITH_UFBXIMPORTER=ON
		-DMAGNUM_WITH_WEBPIMAGECONVERTER=ON
		-DMAGNUM_WITH_WEBPIMPORTER=ON
	)
	cmake_src_configure
}

src_install() {
	cmake_src_install
	mkdir "${ED}/usr/$(get_libdir)/magnum/"
	cp -av "${BUILD_DIR}"/Gentoo/lib/magnum/* "${ED}/usr/$(get_libdir)/magnum/" || die
}

# kate: replace-tabs off;
